﻿using System.Collections.Generic;
using System.Runtime.Serialization;

namespace NewsSystem.ClientModels
{
    [DataContract(Name = "Article")]
    public class ArticleModel
    {
        private ICollection<ImageModel> images;

        public ArticleModel()
        {
            this.images = new HashSet<ImageModel>();
        }

        [DataMember(Name = "id")]
        public int Id { get; set; }

        [DataMember(Name = "title")]
        public string Title { get; set; }

        [DataMember(Name = "content")]
        public string Content { get; set; }

        [DataMember(Name = "images")]
        public ICollection<ImageModel> Images
        {
            get
            {
                return this.images;
            }

            set
            {
                this.images = value;
            }
        }

        [DataMember(Name = "comments")]
        public ICollection<CommentModel> Comments { get; set; }

        [DataMember(Name = "rating")]
        public int Rating { get; set; }

        [DataMember(Name = "voteValue")]
        public int VoteValue { get; set; }
    }
}